Skip to content

Drop scVelo as hard dependency, add as optional pip extra#1314

Merged
Marius1311 merged 2 commits intomainfrom
scvelo/optional-dep
Mar 9, 2026
Merged

Drop scVelo as hard dependency, add as optional pip extra#1314
Marius1311 merged 2 commits intomainfrom
scvelo/optional-dep

Conversation

@Marius1311
Copy link
Collaborator

Final step of the scVelo removal: drop scVelo from hard dependencies and make it an optional pip extra for velocity embedding stream/grid plots.

Changes

pyproject.toml

  • Remove scvelo>=0.3 from [project] dependencies
  • Add optional-dependencies.scvelo = ["scvelo>=0.3"] — used by TmatProjection.plot() for scv.pl.velocity_embedding_stream/grid (already import-guarded via _check_module_importable)
  • Keep scvelo>=0.3 in [dependency-groups] test — needed for 5 projection tests

Source docstrings & comments

  • Fix stale scvelo.pl.scatterscanpy.pl.embedding ref in _base_kernel.py random walk kwargs docstring
  • Drop scvelo compat: prefix from 4 legend-loc normalization comments (code uses scanpy directly now)
  • Remove scvelo/issues/673 URL comment from _term_states_estimator.py (bug is in CellRank's own code)

Tests

  • Move top-level import scvelo in tests/_helpers.py inside _create_dummy_adata() — only used for offline test data regeneration, never at test runtime

What stays

  • Attribution comments ("copied from scvelo", "adapted from scvelo") — kept for credit
  • docs/conf.py intersphinx mapping for scvelo — projection docstrings still cross-reference it
  • tests/conftest.py try/except scvelo import — sets figdir for projection tests
  • tests/test_plotting.py test_scvelo_* test names — historical, functional

Closes the scVelo removal plan (.github/prompts/PLAN_scvelo_removal.md).
Follows #1301 and #1302.

- Remove `scvelo>=0.3` from `[project] dependencies`
- Add `optional-dependencies.scvelo = ["scvelo>=0.3"]` for velocity
  embedding stream/grid plots (already import-guarded in _projection.py)
- Keep scVelo in `[dependency-groups] test` for projection tests
- Fix stale docstring ref `scvelo.pl.scatter` → `scanpy.pl.embedding`
  in _base_kernel.py
- Drop `scvelo compat:` prefix from 4 legend_loc comments — the code
  now uses scanpy directly
- Remove `scvelo/issues/673` URL comment (bug is in CellRank's own code)
- Move top-level `import scvelo` in tests/_helpers.py inside
  `_create_dummy_adata()` (only used for offline data regeneration)
@Marius1311 Marius1311 merged commit fdfbba6 into main Mar 9, 2026
10 checks passed
@Marius1311 Marius1311 deleted the scvelo/optional-dep branch March 9, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant